{% comment %}
<!--
  Copyright (C) 2008 ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
  - http://heavyz.blogspot.com/
  - http://buggarden.blogspot.com/

  The restaurant's address section.
  
  Created on 2008-11-07.
  $Id: resto_address.html 270 2008-11-07 19:13:13Z heavyzheng $
-->
{% endcomment %}

<div id="resto_address" class="section">

  {% if error %}
    <div class="error message">
      {{ error }}
      <a href="javascript:void(0);" onclick="closeMessage('#resto_address')">[close]</a>
    </div>
  {% endif %}
  
  <div class="form-toggle">
    
    <div class="address">
      {{ resto.address|default:"<i>No address</i>" }}<br/>
      {% if resto.post_code %}
        <a href="/fnr/search/post_code/{{ resto.post_code }}/">{{ resto.post_code }}</a>
      {% endif %}
      {% if resto.city %}
        <a href="/fnr/search/city/{{ resto.city }}/">{{ resto.city.capitalize }}</a>
      {% endif %}
    </div><!--/.address-->
    
    {% if editable %}
      {% if resto.is_current_user_editor or is_admin %}
        <div>
          <a href="javascript:void(0);" onclick="showEditForm('#resto_address')">[edit]</a>
        </div>
      {% endif %}
    {% endif %}
  
  </div><!--/.form-toggle-->
  
  {% if editable %}
    {% if resto.is_current_user_editor or is_admin %}

      <form class="edit-form hidden" action="." method="POST">
        <input type="hidden" name="section" value="resto_address"/>
        <table class="noborder">
          <tr>
            <td class="nowrap" width="1%" align="right">Address:</td>
            <td class="nowrap">
              <input type="text" size="60" name="address" value="{{ resto.address|default:"" }}"/>
            </td>
          </tr>
          <tr>
            <td class="nowrap" width="1%" align="right">Post code:</td>
            <td class="nowrap">
              <input type="text" size="60" name="post_code" value="{{ resto.post_code|default:"" }}"/>
            </td>
          </tr>
          <tr>
            <td class="nowrap" width="1%" align="right">City:</td>
            <td class="nowrap">
              <input type="text" size="60" name="city" value="{{ resto.city.capitalize|default:"" }}"/>
            </td>
          </tr>
          <tr>
            <td></td>
            <td class="nowrap">
              <input type="button" value="Update" onclick="submitEditForm('#resto_address');"/>
              <input type="button" value="Cancel" onclick="hideEditForm('#resto_address');"/>
            </td>
          </tr>
        </table>
      </form><!--/.edit-form-->
      
      <div class="submitting hidden">
        <img src="/static/fnr/images/waiting.gif" alt="Submitting"/>
        Submitting your request... Please wait...
      </div><!--/.submitting-->
    
    {% endif %}
  {% endif %}

</div><!--/#resto_address-->



